package com.taobao.api.request;

import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.SimbaKeywordsDeleteResponse;

/**
 * TOP API: taobao.simba.keywords.delete request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class SimbaKeywordsDeleteRequest implements TaobaoRequest<SimbaKeywordsDeleteResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 推广计划Id
   */
  private Long                campaignId;

  /**
   * 关键词Id数组，最多100个
   */
  private String              keywordIds;

  /**
   * 主人昵称
   */
  private String              nick;

  public void setCampaignId(Long campaignId) {
    this.campaignId = campaignId;
  }

  public Long getCampaignId() {
    return this.campaignId;
  }

  public void setKeywordIds(String keywordIds) {
    this.keywordIds = keywordIds;
  }

  public String getKeywordIds() {
    return this.keywordIds;
  }

  public void setNick(String nick) {
    this.nick = nick;
  }

  public String getNick() {
    return this.nick;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.simba.keywords.delete";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("campaign_id", this.campaignId);
    txtParams.put("keyword_ids", this.keywordIds);
    txtParams.put("nick", this.nick);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<SimbaKeywordsDeleteResponse> getResponseClass() {
    return SimbaKeywordsDeleteResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(campaignId, "campaignId");
    RequestCheckUtils.checkNotEmpty(keywordIds, "keywordIds");
    RequestCheckUtils.checkMaxListSize(keywordIds, 100, "keywordIds");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
